---------------------------------------------------------------------------------- 
-- Engineer: David McNamara
-- 

-- Module Name:   ascii_slv
-- Description:  Convert ascii text to the eight bit value

----------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

package ascii_slv is

  function ascii_to_slv(c : character) return std_logic_vector;


end ascii_slv;

package body ascii_slv is

  function ascii_to_slv (c : character) return std_logic_vector is
    variable slv_value : std_logic_vector(7 downto 0);
  begin
    case c is
      when 'A' =>
        slv_value := X"41";
      when 'B' =>
        slv_value := X"42";
      when 'C' =>
        slv_value := X"43";
      when 'D' =>
        slv_value := X"44";
      when 'E' =>
        slv_value := X"45";
      when 'F' =>
        slv_value := X"46";
      when 'G' =>
        slv_value := X"47";
      when 'H' =>
        slv_value := X"48";
      when 'I' =>
        slv_value := X"49";
      when 'J' =>
        slv_value := X"4A";
      when 'K' =>
        slv_value := X"4B";
      when 'L' =>
        slv_value := X"4C";
      when 'M' =>
        slv_value := X"4D";
      when 'N' =>
        slv_value := X"4E";
      when 'O' =>
        slv_value := X"4F";
      when 'P' =>
        slv_value := X"50";
      when 'Q' =>
        slv_value := X"51";
      when 'R' =>
        slv_value := X"52";
      when 'S' =>
        slv_value := X"53";
      when 'T' =>
        slv_value := X"54";
      when 'U' =>
        slv_value := X"55";
      when 'V' =>
        slv_value := X"56";
      when 'W' =>
        slv_value := X"57";
      when 'X' =>
        slv_value := X"58";
      when 'Y' =>
        slv_value := X"59";
      when 'Z' =>
        slv_value := X"5A";
      when '0' =>
        slv_value := X"30";
      when '1' =>
        slv_value := X"31";
      when '2' =>
        slv_value := X"32";
      when '3' =>
        slv_value := X"33";
      when '4' =>
        slv_value := X"34";
      when '5' =>
        slv_value := X"35";
      when '6' =>
        slv_value := X"36";
      when '7' =>
        slv_value := X"37";
      when '8' =>
        slv_value := X"38";
      when '9' =>
        slv_value := X"39";
      when '.' =>
        slv_value := X"2E";
      when ' ' =>
        slv_value := X"20";
      when '^' =>
        slv_value := X"0A";
      when '\' =>
        slv_value := X"0D";
      when others =>
        slv_value := X"00";
    end case;
    return slv_value;
  end;
  
end ascii_slv;
